<!DOCTYPE html>
<html>

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>yqTextFunc</title>
    <uieip type="file" value="inc" src="/yqwin/easyui/include.txt" cache="true" minute="1440"></uieip>
    <uieip type="file" value="css" src="/yqwin/css/yqwin.min" cache="false"></uieip>
    <uieip type="file" value="js" src="/yqwin/data/yqwin.min" cache="false"></uieip>
</head>

<body>
    <h1>21.yqTextFunc</h1>
    <input id="tb" type="text" style="width:280px;">
    <p></p>
    <a href="#" class="easyui-linkbutton" data-options="" onclick="javascript:setValue()">setValue</a>
    <a href="#" class="easyui-linkbutton" data-options="" onclick="javascript:clearValue()">clear</a>
    <a href="#" class="easyui-linkbutton" data-options="" onclick="javascript:getValue()">getValue</a>
    <a href="#" class="easyui-linkbutton" data-options="" onclick="javascript:isEdit(true)">isEdit==true</a>
    <a href="#" class="easyui-linkbutton" data-options="" onclick="javascript:isEdit(false)">isEdit==false</a>
    <a href="#" class="easyui-linkbutton" data-options="" onclick="javascript:destroy()">destroy</a>
    <script>
        $(function () {
            $("#tb").yqTextFunc({
                value: "", //默认值
                isEdit: true,
                beforeBindingTitle: function (callback) {
                    callback();
                }, //标题绑定前
                afterBindingTitle: function () { },   //标题绑定后

                funcCallback: function (prevent_e, mdiinfo, callback) {
                    var value = "12-12-12-12";
                    callback(true, value);
                },
                beforeClear: function (callback) {
                    callback(true);
                },
                afterChange: function (value) {

                },
            });
        });

        function setValue() {
            $("#tb").yqTextFunc("setValue", "AA1-BB1-CC1");
        }

        function clearValue() {
            $("#tb").yqTextFunc("clear");
        }

        function getValue() {
            var val = $("#tb").yqTextFunc("getValue");
            console.log("getValue", val);
        }

        function isEdit(tf) {
            $("#tb").yqTextFunc("isEdit", tf);
        }

        function destroy() {
            $("#tb").yqTextFunc("destroy");
        }

    </script>
</body>

</html>